package com.example.springbootproject.mianshi.aspectJ;


import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class UserProxy {

    // 抽取相同切入点
    @Pointcut(value = "execution(* com.example.springbootproject.mianshi.aspectJ.*.*(..))")
    public void pointCut(){

    }

    @Before(value = "pointCut()")
    public void before(){
        System.out.println("-----前置通知------");
    }

    @After(value = "pointCut()")
    public void after(){
        System.out.println("-----后置通知-----");
    }
}
